package main

import (
	"fmt"
	"runtime/debug"
)

func test1() {
	test2()
}

func test2() {
	test3()
}

func test3() {
	fmt.Printf("%s", debug.Stack())
	debug.PrintStack()
}

func main() {
	test1()
}

/**
打印内容(出现了2遍):
goroutine 1 [running]:
runtime/debug.Stack(0xc000081f38, 0x458a24, 0x4af1e0)
	C:/Go/src/runtime/debug/stack.go:24 +0xa4
main.test3()
	E:/GoMod/walk/examples/actions/test.go:17 +0x2d
main.test2(...)
	E:/GoMod/walk/examples/actions/test.go:13
main.test1(...)
	E:/GoMod/walk/examples/actions/test.go:9
main.main()
	E:/GoMod/walk/examples/actions/test.go:22 +0x29

goroutine 1 [running]:
runtime/debug.Stack(0x168, 0x0, 0x0)
	C:/Go/src/runtime/debug/stack.go:24 +0xa4
runtime/debug.PrintStack()
	C:/Go/src/runtime/debug/stack.go:16 +0x29
main.test3()
	E:/GoMod/walk/examples/actions/test.go:18 +0xa3
main.test2(...)
	E:/GoMod/walk/examples/actions/test.go:13
main.test1(...)
	E:/GoMod/walk/examples/actions/test.go:9
main.main()
	E:/GoMod/walk/examples/actions/test.go:22 +0x29
 */